package com.chapter11.chap_exercise;

public class Test05 {
    public static void main(String[] args) {
        new A().ok();
    }
}

@SuppressWarnings({"all"})
class A {

    private void hi() {
        System.out.println("hi");
    }

    //局部内部类在代码块中
    {
        class B {
            private final String name = "你好";

            public void show() {
                System.out.println(name);
                hi();
            }
        }
    }

    //局部内部类在方法中
    public void ok() {
        class C {

            private final String name = "你好";

            public void show() {
                System.out.println(name);
                hi();
            }
        }
        new C().show();
    }


}